Skip to content

Readme scheduler#10614

Merged
lgirdwood merged 1 commit intothesofproject:mainfrom
lgirdwood:readme-scheduler
Mar 12, 2026
Merged

Readme scheduler#10614
lgirdwood merged 1 commit intothesofproject:mainfrom
lgirdwood:readme-scheduler

Conversation

@lgirdwood
Copy link
Member

Add some information about the different schedulers.

Copilot AI review requested due to automatic review settings March 10, 2026 16:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new src/schedule/README.md describing SOF’s scheduling architecture and the roles/interactions of the LL, DP, and TWB schedulers within the Zephyr-based implementation.

Changes:

  • Introduces an overview of the three scheduler types (LL/DP/TWB) and their intended workloads.
  • Adds architecture and state-diagram documentation (Mermaid) for each scheduler.
  • Documents high-level interactions between scheduler domains and Zephyr threads/timers/interrupts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +73
- **Post-Run**: After all tasks execute, it triggers a `NOTIFIER_ID_LL_POST_RUN` event. This event cascades to wake up other dependent schedulers like DP and TWB.

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section states the LL scheduler always triggers NOTIFIER_ID_LL_POST_RUN, but in src/schedule/zephyr_ll.c the notifier is compiled out when CONFIG_SOF_USERSPACE_LL is enabled. Please clarify that this post-run event is conditional (or document the userspace equivalent path, if any).

Copilot uses AI. Check for mistakes.
Add some information about the different schedulers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note inline, but otherwise looks good.

- **Domain Threads**: The LL scheduler runs within a dedicated high-priority Zephyr thread (`ll_thread0`, etc.) pinned to each core (`zephyr_domain.c`).
- **Triggers**: It is woken up by a hardware timer (e.g., a 1ms tick) or directly by hardware DMA interrupts (`zephyr_dma_domain.c`).
- **Execution**: Once woken up, it locks the domain, iterates through all scheduled tasks in priority order, moves them to a temporary list, and calls their `.run()` functions.
- **Post-Run**: After all tasks execute, it triggers a `NOTIFIER_ID_LL_POST_RUN` event. This event cascades to wake up other dependent schedulers like DP and TWB. Event not run on LL userspace configuration.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is describing work-in-progress limitations of the LL userspace configuration. Not sure if this should be left in the toplevel documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, will be a good test for AGENTS.md, which copilot should also respect (soon I hope) when reviewing.

@lgirdwood lgirdwood merged commit 87ee8a0 into thesofproject:main Mar 12, 2026
47 of 52 checks passed
@lgirdwood lgirdwood deleted the readme-scheduler branch March 12, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants